﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Mytrip.Users.mytrip_Users>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Html.Encode(Model.UserName) %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%= Html.Encode(Model.UserName) %></h2>

        <table style="width: 100%;">
        <tr>
        <th style="text-align: right"><h2>Account Information</h2></th>
        <th></th>
        </tr>
        
        <tr>
        
       <th style="text-align: right">
            Email:</th><td>
            <%= Html.Encode(Model.mytrip_Membership.Email) %>
        </td></tr>
        <tr><th style="text-align: right">
            Last Activity Date:</th><td>
            <%= Html.Encode(String.Format("{0:g}", Model.LastActivityDate)) %>
        </td></tr>
        <tr><th style="text-align: right">
            Creation Date:</th><td>
            <%= Html.Encode(String.Format("{0:g}", Model.mytrip_Membership.CreationDate)) %>
       </td> </tr>
        <tr><th style="text-align: right">
            Last Login Date:</th><td>
            <%= Html.Encode(String.Format("{0:g}", Model.mytrip_Membership.LastLoginDate)) %>
        </td></tr>
        <tr><th style="text-align: right">
            Last Password Changed Date:</th><td>
            <%= Html.Encode(String.Format("{0:g}", Model.mytrip_Membership.LastPasswordChangedDate)) %>
       </td> </tr>
        <tr><th style="text-align: right">
            User IP:</th><td>
            <%= Html.Encode(Model.mytrip_Membership.UserIP) %>
       </td> </tr> 
        <tr><th style="text-align: right">
            IsApproved: </th><td>
            <%if (Model.mytrip_Membership.IsApproved)
              { %>The user is approved <img src="/content/images/approved.png" alt="Approved" style="border-width: 0px; width: 15px;" />    [ <a href="<%=Url.Action("IsApproved", new {  id =Model.UserName })%>" onclick="return confirm ('Are you sure?');">
                                <img src="/content/images/noapproved.png" alt="Not Approved" style="border-width: 0px; width: 15px;" /></a>]
                <%}
              else {%>The user is not approved <img src="/content/images/noapproved.png" alt="Not Approved" style="border-width: 0px; width: 15px;" />    [ <a href="<%=Url.Action("IsApproved", new {  id =Model.UserName })%>" onclick="return confirm ('Are you sure?');">
                                <img src="/content/images/approved.png" alt="Approved" style="border-width: 0px; width: 15px;" /></a>]
                <% } %>
        </td></tr>
    
        <tr><th style="text-align: right"><h2>Role Information</h2></th>
        <% using (Html.BeginForm("IsUserInRole", "Admin", new { id = Model.UserName }))
   { %>
   <th style="text-align: right; vertical-align: middle;"> <%= Html.DropDownList("id2", (IEnumerable<SelectListItem>)ViewData["roles"], "Choose a role")%>
    <input type="submit" value="Add User to Role" /></th>
<%} %>
        </tr>
        <%foreach (mytrip_Roles item in Model.mytrip_Roles)
          {  %><tr><th style="text-align: right"><%=item.RoleName %></th><td>The user in role <img src="/content/images/approved.png" alt="Approved" style="border-width: 0px; width: 15px;" />    [ <a href="<%=Url.Action("IsUserInRole", new { id = Model.UserName, id2 = item.RoleName })%>" onclick="return confirm ('Are you sure?');">
                                <img src="/content/images/noapproved.png" alt="Cut" style="border-width: 0px; width: 15px;" /></a>]
        </td></tr><%} %>

</table>
       
    <p>
        <%=Html.ActionLink("Back to List", "Index") %>
    </p>

</asp:Content>
